home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / telecomm / bbs / bigcpsspeedv21.lha / BIG_CPS_Speed < prev   
Encoding:
Text File  |  1993-06-07  |  8.4 KB  |  124 lines

  1. /**************************************************************************\
  2. |*                                                                        *|
  3. |*    "BIG_CPS_Speed", v2.1 written for CNet Amiga, v2.63 by Dotoran!     *|
  4. |*                                                                        *|
  5. \**************************************************************************/
  6. options results ; signal on ERROR ; signal on SYNTAX ; signal on IOERR
  7. tr=transmit ; se=sendstring ; gc=getchar ; qu=query ; gu=getuser
  8.  
  9. /********************-SysOp-Definable-Variables-**(See-the-README!-file)***/
  10.  c1 = d            /* Color of Top Text Line ("The average rate...)       */
  11.  c2 = f            /* Color or Mid Text Line (Varies w/ CPS Rate)         */
  12.  c3 = 6            /* Color of Low Text Line ("Record for this...)        */
  13.  c4 = e            /* Color of the BIG Numbers   ________________________ */
  14.  c5 = b            /* Color of the BIG CPS       | Use MCI Color Codes! | */
  15.  c6 = 9            /* Color of Little % Numbers  ~~~~~~~~~~~~~~~~~~~~~~~~ */
  16.  c7 = f            /* Color of Record CPS Number, Handle & Date           */
  17.  c8 = f            /* Color of Actual CPS Number (Use "x" for BAR Color)  */
  18.  c9 = a            /* Color of Percent Signs (excluding c7 %)             */
  19. c10 = 8            /* Color of the Grid CPS BAR Travels Across            */
  20. c11 = 6            /* Color of   0-25%  CPS Bar Segment                   */
  21. c12 = e            /* Color of  25-50%  CPS Bar Segment                   */
  22. c13 = 3            /* Color of  50-75%  CPS Bar Segment                   */
  23. c14 = b            /* Color of  75-100% CPS Bar Segment                   */
  24. c15 = 9            /* Color of 100-125% CPS Bar Segment                   */
  25. c16 = 1            /* Test Mode  (0=Off;Use With BBS, 1=On;Test Colors)   */
  26. c17 = 0            /* Test Mode2 (Only if c16=1; 0=Use ANSI, 1=Use ASCII) */
  27.  
  28.  v1 = 7     /* Reset CPS File(s) After THIS MANY DAYS (Between 0 and 30)  */
  29.  v2 = 50    /* Minimum SIZE (in KB) before CPS Rate will be used.         */
  30.  v3 = 1     /* Use Separate Upload/Download High CPS Files? (1=Yes, 0=No) */
  31.  
  32.  v4 = 1307358         /* ONLY Modify V4 if told to do so by DOTORAN.      */
  33. /**************************************************************************/
  34. gu 24 ; baud=result ; gu 1  ; handle=result ; t=time('s') ; line.='c'c4
  35. gu 28 ; term=result ; gu v4 ; lc=left(upper(result),1)
  36. file1='sysdata:log/uloads' ; file2='sysdata:log/dloads'
  37. date=date('s') ; cps=0 ; up=0 ; dn=0
  38. if c16=1 then do ; cps=random(480,1440,t) ; lc='D' ; end
  39. if c16=1 & c17=0 then term=2 ; if c16=1 & c17=1 then term=1
  40. if term>1 then call ANSI ; else call ASCII
  41. path='pfiles:CPS/' ; file=path||baud ; if v3=1 then file=file||lc
  42. if ~exists(path) then tr '$omakedir pfiles:CPS}'
  43. if ~exists(file) then do ; call open(f1,file,'w')
  44.     call writeln(f1,'0|No One Yet!|'date'|x') ; call close(f1) ; end
  45. call open(f1,file,'r') ; r=readln(f1) ; call close(f1)
  46. parse var r hi'|'who'|'date1'|'j
  47. date2=date1+v1 ; if date>date2 then hi=0
  48. if lc='D' then call GETDOWNCPS ; else call GETUPCPS
  49. if cps=0 then exit ; else do ; rate=((CPS/baud)*100)%1 ; r=rate%10 ; end
  50. sp.1='Horrible. Why did you even bother?' ; sp.2='Pathetic. US Mail would have been faster!'
  51. sp.3='That was pretty lousy.' ; sp.4='Needs work.' ; sp.5='(YAWN)'
  52. sp.6='Not TOO bad.' ; sp.7='Getting there...' ; sp.8='Looks about right!'
  53. sp.9='Zooming right along!' ; sp.10='Wow, pretty hot!' ; sp.11='Vroom!'
  54. sp.12='Speed Demon!' ; sp.13='Broke the sound barrier on that one!'
  55. sp.14='Outta Sight!' ; sp.15='Lord Almighty!' ; sp.16='Flaming Phone Lines!'
  56. sp.17='Melting Modems!' ; sp.18='c9HOLY SHITcf!'
  57. speed=sp.r ; if r<1 then speed=sp.1 ; if r>18 then speed=sp.18
  58. do k=1 to 4+term ; do i=1 to length(cps) ; m=substr(cps,i,1)
  59. line.k=line.k||n.m.term.k' ' ; end i ; line.k=line.k'  c'c5||cps.term.k ; end k
  60. tr 'f10Hc'c1'The average rate for this transfer wasn1'
  61. do i=1 to 4+term ; tr center(line.i,82) ; end i ; c8='c'c8
  62. tr 'n1c'c2||center(speed,78)'n1' ; if c8='x' then c8=''
  63. se 'Cc'c6'0c'c9'%>7c'c6'25c'c9'%>7c'c6'50c'c9'%>7c'c6
  64. tr '75c'c9'%>6c'c6'100c'c9'%>6c'c6'125c'c9'%c'c10
  65. do i=1 to 3 ; tr sh.term.i ; end i ; color=c11||c12||c13||c14||c15
  66. se '^2>e' ; d=(rate*.4)%1 ; if d>49 then d=49 ; else if d<1 then d=1
  67. do i=1 to d ; se 'c'substr(color,(i%10)+1,1)sh.term.4 ; end i
  68. tr '>1'c8||rate'%n1' ; if cps<=hi then do
  69.     se 'n1c'c3'The Record c'c4'CPS c'c3'at this Baudc'c2': c'c5||left(hi,5)
  70.     tr 'c'c3'Set byc'c2': c'c5||who' c'c3'Onc'c2': c'c9||date('n',date1,'s')'c'c3'!' ; exit ; end
  71. if cps>hi then do ; se 'n1c9You broke the c'c4'CPS c9record ofc'c2': c'c5||left(hi,5)
  72.     tr 'c9Set byc'c2': c'c5||who'c9 Onc'c2': c'c9||date('n',date1,'s')'c9!'
  73.     call open(f1,file,'w') ; call writeln(f1,cps'|'handle'|'date'|x') ; call close(f1)
  74.     se 'n1cfNEW c'c3'Record c'c4'CPS c'c3'at this Baudc'c2': c'c5||left(cps,5)
  75.     tr 'c'c3'Set byc'c2': c'c5||handle' c'c3'Onc'c2': c'c9||date('n',date,'s')'c'c3'!' ; exit ; end
  76. GETUPCPS:
  77.     call open(f1,file1,'r') ; do up=1 until eof(f1) ; up.up=readln(f1) ; end up
  78.     call close(f1) ; do i=up-1 to 1 by -1
  79.         parse var up.i 20 hdl.i 40 null 49 cps.i 53 null 70 len.i null
  80.         if handle~=hdl.i then leave i ; if len.i>v2 & cps.i>cps then cps=cps.i
  81.     end i ; return
  82. GETDOWNCPS:
  83.     call open(f1,file2,'r') ; do dn=1 until eof(f1) ; dn.dn=readln(f1) ; end dn
  84.     call close(f1) ; do i=dn-1 to 1 by -1
  85.         parse var dn.i 20 hdl.i 40 null 49 cps.i 53 null 70 len.i null
  86.         if handle~=hdl.i then leave i ; if len.i>v2 & cps.i>cps then cps=cps.i
  87.     end i ; return
  88. ASCII:
  89.     n.0.1.1=' ##### ' ; n.0.1.2='#   ###' ; n.0.1.3='#  #  #' ; n.0.1.4='###   #' ; n.0.1.5=' ##### '
  90.     n.1.1.1=' ## '    ; n.1.1.2='### '    ; n.1.1.3=' ## '    ; n.1.1.4=' ## '    ; n.1.1.5='####'
  91.     n.2.1.1=' ##### ' ; n.2.1.2='##   ##' ; n.2.1.3='   ##  ' ; n.2.1.4='###    ' ; n.2.1.5='#######'
  92.     n.3.1.1=' ##### ' ; n.3.1.2='##   ##' ; n.3.1.3='   ### ' ; n.3.1.4='##   ##' ; n.3.1.5=' ##### '
  93.     n.4.1.1='##  ## ' ; n.4.1.2='##  ## ' ; n.4.1.3='#######' ; n.4.1.4='    ## ' ; n.4.1.5='    ## '
  94.     n.5.1.1='###### ' ; n.5.1.2='##     ' ; n.5.1.3='###### ' ; n.5.1.4='     ##' ; n.5.1.5='###### '
  95.     n.6.1.1='  #### ' ; n.6.1.2=' ##    ' ; n.6.1.3='###### ' ; n.6.1.4='##   ##' ; n.6.1.5=' ##### '
  96.     n.7.1.1='#######' ; n.7.1.2='     ##' ; n.7.1.3='    ## ' ; n.7.1.4='   ##  ' ; n.7.1.5='  ##   '
  97.     n.8.1.1=' ##### ' ; n.8.1.2='##   ##' ; n.8.1.3=' ##### ' ; n.8.1.4='##   ##' ; n.8.1.5=' ##### '
  98.     n.9.1.1=' ##### ' ; n.9.1.2='##   ##' ; n.9.1.3=' ######' ; n.9.1.4='    ## ' ; n.9.1.5=' ####  '
  99.     cps.1.1=' #####  ######   ##### ' ; cps.1.2='##   ## ##   ## ##     ' ; cps.1.3='##      ######   ##### '
  100.     cps.1.4='##   ## ##           ##' ; cps.1.5=' #####  ##       ##### '
  101.     sh.1.1='C|--------|---------|---------|--------|----------|' ; sh.1.4='*'
  102.     sh.1.2='C|        |         |         |        |          |' ; term=1
  103.     sh.1.3='C|--------`---------`---------`--------`----------|' ; return
  104. ANSI:
  105.     n.0.0.1=' ÜÜÜÜÜ ' ; n.0.0.2='ÛÛ  ÜÛÛ' ; n.0.0.3='ÛÛÜß ÛÛ' ; n.0.0.4='ßÛÜÜÜÛß'
  106.     n.1.0.1=' ÜÜ '    ; n.1.0.2='ßÛÛ '    ; n.1.0.3=' ÛÛ '    ; n.1.0.4='ÜÛÛÜ'
  107.     n.2.0.1=' ÜÜÜÜÜ ' ; n.2.0.2='ßß   ÛÛ' ; n.2.0.3='ÜÛßßßß ' ; n.2.0.4='ÛÛÜÜÜÜÜ'
  108.     n.3.0.1=' ÜÜÜÜÜ ' ; n.3.0.2='ßß   ÛÛ' ; n.3.0.3='   ßßÛÜ' ; n.3.0.4='ßÛÜÜÜÛß'
  109.     n.4.0.1='ÜÜ   ÜÜ' ; n.4.0.2='ÛÛ   ÛÛ' ; n.4.0.3=' ßßßßÛÛ' ; n.4.0.4='     ÛÛ'
  110.     n.5.0.1='ÜÜÜÜÜÜÜ' ; n.5.0.2='ÛÛÜÜÜÜ ' ; n.5.0.3='     ÛÛ' ; n.5.0.4='ßÛÜÜÜÛß'
  111.     n.6.0.1='  ÜÜÜ  ' ; n.6.0.2='ÜÛß    ' ; n.6.0.3='ÛÛßßßÛÜ' ; n.6.0.4='ßÛÜÜÜÛß'
  112.     n.7.0.1='ÜÜÜÜÜÜÜ' ; n.7.0.2='     ÛÛ' ; n.7.0.3='   ÜÛß ' ; n.7.0.4='  ÛÛ   '
  113.     n.8.0.1=' ÜÜÜÜÜ ' ; n.8.0.2='ÛÛ   ÛÛ' ; n.8.0.3='ÜÛßßßÛÜ' ; n.8.0.4='ßÛÜÜÜÛß'
  114.     n.9.0.1=' ÜÜÜÜÜ ' ; n.9.0.2='ÛÛ   ÛÛ' ; n.9.0.3=' ßßßßÛÛ' ; n.9.0.4='ßÛÜÜÜÛß'
  115.     cps.0.1=' ÜÜÜÜÜ  ÜÜÜÜÜÜ   ÜÜÜÜÜ ' ; cps.0.2='ÛÛ   ßß ÛÛ   ÛÛ ÛÛ   ßß'
  116.     cps.0.3='ÛÛ      ÛÛßßßß   ßßßßÛÜ' ; cps.0.4='ßÛÜÜÜÛß ÛÛ      ßÛÜÜÜÛß'
  117.     sh.0.1='CÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´' ; sh.0.4='Û'
  118.     sh.0.2='C³        ³         ³         ³        ³          ³' ; term=0
  119.     sh.0.3='CÃÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄ´' ; return
  120. ERROR: ; SYNTAX: ; IOERR: ; tr 'ERROR:'rc' ('errortext(rc)') @ 'sigl
  121.     logentry 'ER:'rc' ('errortext(rc)') @ 'sigl' BIG CPS Speed v2.0'
  122.     bufferflush ; exit
  123. /*                         < END OF FILE MARKER >                         */
  124.